package com.honvay.cola.cloud.uc.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;

/**
 * Created by bojieshen on 2018/3/14 0014.
 */
@ApiModel(value = "SysRegisterDTO对象", description = "用户对象SysRegisterDTO")
@Data
public class SysRegisterDTO {

    /**
     * 注册来源编号
     */
    @ApiModelProperty(value = "注册来源编号", name = "sourceCode", example = "12341234")
    private String sourceCode;

    /**
     * 推荐人主键
     */
    @ApiModelProperty(value = "推荐人主键", name = "recommendSysUserId", example = "127")
    private Long recommendSysUserId;

    /**
     * 电话号码
     */
    @NotEmpty(message = "电话号码不能空")
    @ApiModelProperty(value = "电话号码", name = "phoneNumber", example = "18820174159")
    private String phoneNumber;

    /**
     * 登录密码
     */
    @NotEmpty(message = "登录密码不能空")
    @Length(min = 6, max = 20, message = "密码长度范围[6,20]之间")  //被注释的字符串的大小必须在指定的范围内
    @ApiModelProperty(value = "登录密码", name = "password", example = "111111")
    private String password;

    /**
     * 注册用户类型 1-用户 2-管理员
     */
    @NotNull(message = "注册用户类型不能空")
    @Range(min = 1, max = 2, message = "注册用户类型只能为1或2")
    @ApiModelProperty(value = "注册用户类型 1-用户 2-管理员", name = "type", example = "1")
    private Integer type;

}
